Matplotlib


2018.Jan.30

1. Introduction

  1. Matplotlib is a Python 2D plotting library.
  2. It produces publication quality figures in hardcopy formats and interactive environments across platforms.
  3. It can be used in Python scripts, the Python and IPython shell, the jupyter notebook, web application servers, and four graphical user interface toolkits.
  4. Users can generate plots, histograms, power spectra, bat charts, errorcharts, scatterplots, etc., with few lines of code.
    > For simple plotting, the pyplot module provides a MATLAB-like interface, particularly when combined with _IPython
    > For the power user, they can have full control of line styles, font properties, axes properties, etc, via an object oriented interface or via a set of functions familiar to MATLAB users.

2. Sample plots in Matplotlib

  • Matplotlib has 24 sample plots.
  • Sample plots including: Line plot, Multiple subplots in one figure, Images, Contouring and pseudocolor, Histograms, Paths, Three-dimensional plotting, Streamplot, Ellipses, Bar charts, Pie charts, Tables, Scatter plots, GUI widgets, Filled curves, Date handling, Log plots, Polar plots, Legends, TeX-notation for text objects, Native TeX rendering, EEG GUI, XKCD-style sketch plots, Subplot example.

  • Sample plots
    https://matplotlib.org/tutorials/introductory/sample_plots.html

  • Gallery
    https://matplotlib.org/gallery/index.html

3. Installation & Documentation

4. Toolkits

mplot3d

axes_grid1

axesartist
API

5. Third Party Packages

External packages that extend or build on Matplotlib functionality are maintained and distributed separately from Matplotlib and thus need to be installed individually.

Third party packages including: several higher-level plotting interfaces - seaborn, holoviews, ggplot, and two projection and mapping toolkits - baseman and cartopy.

Mapping toolkits

Basemap

Cartopy

Declarative libraries

ggplot

holoviews
  • holoviews makes it easier to visualize data interactively, especially in a Jupyter notebook, by providing a set of declarative plotting objects that store your data and associated metadata.
  • Official web http://holoviews.org/

Specialty plots

DeciDa
  • DeCiDa is a library of functions and classes for electron device characterization, electronic circuit design and general data visualization and analysis.
  • Documentation https://pypi.python.org/pypi/DeCiDa
Matplotlib-Venn
mpl-probscale
  • mpl-probscale is a small extension that allows Matplotlib users to specify probabilty scales. Simply importing the probscale module registers the scale with Matplotlib, making it accessible via e.g., ax.set_xscale('prob') or plt.yscale('prob')
  • Documentation http://matplotlib.org/mpl-probscale/

mpl-scatter-density
  • mpl-scatter-density is a small package that makes it easy to make scatter plots of large numbers of points using a density map.
  • When used in interactive mode, the density map is downsampled on-the-fly while panning/zooming in order to provide a smooth interactive experience.
  • Documentation https://github.com/astrofrog/mpl-scatter-density

mplstereonet
  • mplstereonet provides stereonets for plotting and analyzing orientation data.
Natgrid
  • mpl_toolkits.natgrid is an interface to the natgrid C library for gridding irregularly spaced data.
pyUpSet
  • pyUpSet is a static Python implementation of the UpSet suite by Lex et al. to explore complex intersections of sets and data frames.
seaborn
  • seaborn is a high level interface for drawing statistical graphics with Matplotlib.
  • It aims to make visualization a central part of exploring and understanding complex datasets.

Windrose
  • Windrose is a Python Matplotlib, Numpy library to manage wind data, draw windroses (also known as polar rose plots), draw probability density functions and fit Weibull distributions.

Interactivity

mplcursors
  • mplcursors provides interactive data cursors for Matplotlib.
MplDataCursor
  • MpIDataCursor is a toolkit to provide interactive “data cursors” (clickable annotation boxes).

Miscellaneous

adjustText
  • adjustText is a small library for automatically adjusting text position in Matplotlib plots to minimize overlaps between them, specified points and other objects.

iTerm2 terminal backend
  • iTerm2 terminal backend is an external Matplotlib backend using the iTerm2 nightly build inline image display feature.

6. Additional Resources

Videos
Tutorials
Assist
Citing Matplotlib
  • If Matplotlib contributes to a project that leads to a scientific publication, please acknowledge this fact by citing Hunter et al (2007) using this ready-made BibTex entry:

results matching ""

    No results matching ""